<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="file:///C|/wamp/www/assets/ico/favicon.ico">
    <link href="../../css/estilo.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="js/ajax.js"></script> 
    <style type="text/css">
        .bs-example{
            margin: 100px 50px;
        }
    </style>
    <!-- Bootstrap core CSS -->
    <link href="../../css/bootstrap.css" rel="stylesheet" media="screen">
    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <title>Proyecto SGA</title>
</head>

<body class="fondo">
<div id="hld">

    

<div class="container" >
<div class="panel panel-default">
<div class="panel-body">
  <!-- Main component for a primary marketing message or call to action -->
  <div class="well well-lg">
    <div class="imagen_head"><img src="../../img/header/icon-48-category.png" width="48" height="48"></div>
    <div class="titulo_head">Gestor de Niveles</div>
    <div class="toolbar_head">
      <div class="btn-toolbar" role="toolbar">
    	<a href="registrar_nivel.php" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span><br> Nuevo</a>
        <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-question-sign"></span><br> Ayuda</button>
      </div><!-- /btn-toolbar -->  
    </div><!-- /toolbar head -->  
  </div><!-- /Well -->   

<div class="panel panel-default">
  <!-- Default panel contents-->
	<div class="panel-body">

	<form name="form_nivel" action="#" method="post" enctype="multipart/form-data" class="form-inline">
        <div class="form-group">
            <label class="col-lg-3 control-label">Filtro:</label>
        </div>
        <input type="text" name="txtDato_nivel" class="form-control" id="txtDato_nivel">  
        <button type="button" name="txtBuscar" class="btn btn-default" onClick="enviarParametrosNivel()"><span class="glyphicon glyphicon-search"></span> Buscar</button>
        <button type="button" name="txtRestablecer" class="btn btn-default" onClick="restablecer()">Restablecer</button>
	</form>
<p>
    
<?php
include_once("ClsNivel.php");
include_once("../../lib/paginator/paginacion.php");

$objNivel=new ClsNivel;
$total_registros=$objNivel->consultarTotalNiveles();

$objPaginacion = new Paginacion();
while($row=mysql_fetch_array($total_registros)){
		$total=$row['total'];
}

$totalPaginas = $objPaginacion->getTotalPaginas($total);
//$registrosPorPagina = 4;

$paginaActual=$objPaginacion->setPaginaActual($totalPaginas);

// obtenemos cuál es el artículo inicial para la consulta
$inicio = $objPaginacion->setArticuloInicial($paginaActual);

$resultado=$objNivel->consultarNivelPorParametro($criterio,$busqueda,$inicio,$objPaginacion->registrosPorPagina);

?>

<table class="table table-bordered table-striped table-hover">
<thead align="center">
<tr>
	<th align="center">#</th>
	<th>Nombre</a></th>
	<th>ID</a></th>
  	<th>Ver</th>
	<th>Editar</th>
</tr>
</thead>

<tbody class="table" id="table_body_nivel">
<?php

$c=0;
$i=0;

while($row=mysql_fetch_array($resultado)){
	$i=$i+1;
	echo "<td width='10' align='center'>".$i."</td>";
	echo "<td>".$row['NIV_Nombre']."</td>";
	echo "<td width='1%' align='center'>".$row['NIV_IdNivel']."</td>";
	echo "<td width='5%' align='center' class='bs-example tooltip-examples list-inline'><a href=detalle_nivel.php?id_nivel=".$row["NIV_IdNivel"]." title='' data-toggle='tooltip' data-original-title='Ver Detalle'><img src='../../img/ver.png'></td>";
    echo "<td width='5%' align='center' class='bs-example tooltip-examples list-inline'><a href=editar_nivel.php?id_nivel=".$row["NIV_IdNivel"]." title='' data-toggle='tooltip' data-original-title='Editar'><img src='../../img/editar.png'></td>";
	echo "</tr>";
}

?>
</tbody>
<tfoot>
<tr>
    <td colspan="13" bgcolor="#f3f3f3" align="center">
    	<?php 
   		$objPaginacion->paginar($total,$paginaActual,$totalPaginas);
		//$objPaginacion->mostrarTotalResultados($inicio,$total);
		?>

    </td>
</tr>
</tfoot>
</table>


  </div><!-- /panel-body -->
</div><!-- /panel-default -->


</div><!-- /panel general -body -->
</div><!-- /panel general -default -->
</div> <!-- /container -->

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="../../js/jquery.min.js"></script>
    <script src="../../js/bootstrap.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
        $(".tooltip-examples a").tooltip({
            placement : 'top'
        });
    });
    </script>
    
    </div><!-- /hdl -->
  </body>
</html>